{#include main fluid=true}
  {#style}
   .nav-item {
     padding: .5rem .3rem;
   }
   ul#tree, ul.nested {
     list-style-type: none;
   }
   #tree {
     margin: 0;
     padding: 0;
   }
   span.caret {
      cursor: pointer;
      user-select: none;
   }
   span.caret::before {
     content: "\229E";
     color: black;
     display: inline-block;
     margin-right: 6px;
   }
   span.caret-down::before {
     content: "\229F"
     /*transform: rotate(90deg);*/ 
   }
   ul.nested {
     display: none;
   }
   ul.active {
     display: block;
   }
   ul code {
     color: #343a40; 
   }
   ul li {
     margin-top: 5px; 
   }
   span.declaring-class {
     color: gray;
   }
  {/style}  
  {#script}
  var carets = document.getElementsByClassName("caret");
  for (i = 0; i < carets.length; i++) {
    carets[i].addEventListener("click", function() {
      this.parentElement.querySelector(".nested").classList.toggle("active");
      this.classList.toggle("caret-down");
    });
  } 
  {/script}
  {#title}Invocation Trees{/title}
  {#body}
  <ul class="nav">
    <li class="nav-item">
        <input type="submit" class="btn btn-primary btn-sm" value="Refresh"
            onClick="window.location.reload();">
    </li>
    <li class="nav-item">
        <form method="post" enctype="application/x-www-form-urlencoded" class="form-inline">
            <button type="submit" class="btn btn-primary btn-sm">Clear</button>
        </form>
    </li>
    <li class="nav-item">
        <form method="post" enctype="application/x-www-form-urlencoded" class="form-inline">
        <input id="filterOutQuarkusBeans" type="checkbox" class="form-check-input" disabled{#if info:invocationsMonitor.filterOutQuarkusBeans} checked{/if}>
        <label for="filterOutQuarkusBeans">Filter out Quarkus beans</label>
        <input type="hidden" name="action" value="filterOutQuarkusBeans">
        &nbsp;
        <input id="toggle" type="submit" class="btn btn-primary btn-sm" value="Toggle">
    </form>
    </li>
  </ul>
  <table class="table table-striped">
   <thead class="thead-dark">
    <tr>
      <th scope="col">Start <i class="fas fa-caret-down"></i></th>
      <th scope="col" style="width:80%;">Invocations</th>
    </tr>
   </thead>
   <tbody>
    {#each info:invocationsMonitor.lastInvocations.orEmpty}
    <tr>
      <td>{it.startFormatted}</td>
      <td><ul id="tree">{#tree it root=true /}</ul></td>
      </tr>
    {/each}
   </tbody>
  </table>
 {/body}
{/include}
